﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Model
{
    
    public partial class Interview
    {
        #region Family
        private class FamilyMember
        {
            public FamilyMember(string _name, string _relation, string _job, string _health, string _goOutWork)
            {
                Name = _name;
                Relation = _relation;
                Job = _job;
                Health = _health;
                GoOutWork = _goOutWork;
            }
            string Name;
            string Relation;
            string Job;
            string Health;
            string GoOutWork;
        }
        List<FamilyMember> _FamilyMemberList;

        private List<FamilyMember> FamilyMemberList
        {
            get
            {
                if (_FamilyMemberList.Count == null)
                {
                    _FamilyMemberList = new List<FamilyMember>();
                    string[] list = this._family.Split(new string[] { "}" }, StringSplitOptions.RemoveEmptyEntries);
                    foreach (string item in list)
                    {
                        string[] array = item.Substring(item.IndexOf("{") + 1).Split('|');
                        FamilyMember fm = new FamilyMember(array[0], array[1], array[2], array[3], array[4]);
                        _FamilyMemberList.Add(fm);
                    }
                }
                return _FamilyMemberList;
            }
        } 
        #endregion
        #region Teacher
        private string _Teacher_Name;
        public string Teacher_Name
        {
            get
            {
                if (string.IsNullOrEmpty(_Teacher_Name) && !string.IsNullOrEmpty(this._teacher))
                {
                    string[] array = this._teacher.Split('|');
                    _Teacher_Name = array[0];
                    _Teacher_Link = array[1];
                }
                return _Teacher_Name;
            }
        }
        private string _Teacher_Link;

        public string Teacher_Link
        {
            get
            {
                if (string.IsNullOrEmpty(_Teacher_Link) && !string.IsNullOrEmpty(this._teacher))
                {
                    string[] array = this._teacher.Split('|');
                    _Teacher_Name = array[0];
                    _Teacher_Link = array[1];
                }
                return _Teacher_Link;
            }
        }
        #endregion
        #region Principal
        private string _Principal_Name;
        public string Principal_Name
        {
            get
            {
                if (string.IsNullOrEmpty(_Principal_Name) && !string.IsNullOrEmpty(this._principal))
                {
                    string[] array = this._principal.Split('|');
                    _Principal_Name = array[0];
                    _Principal_Link = array[1];
                }
                return _Principal_Name;
            }
        }
        private string _Principal_Link;

        public string Principal_Link
        {
            get
            {
                if (string.IsNullOrEmpty(_Principal_Link) && !string.IsNullOrEmpty(this._principal))
                {
                    string[] array = this._principal.Split('|');
                    _Principal_Name = array[0];
                    _Principal_Link = array[1];
                }
                return _Principal_Link;
            }
        }
        #endregion
    }
}
